<template>
  <view class="entrance-container bg-[#289AFD]">
    <up-popup :show="showPopup" :round="8" mode="center" :overlayOpacity="0">
      <view
        class="px-6.5 py-5 box-border flex flex-col justify-center items-center w-[78vw]"
      >
        <text class="text-black text-[36rpx] font-bold">码上朝阳温馨提示</text>
        <text
          class="text-black text-[26rpx] text-left mt-4 leading-[48rpx] indent-6"
        >
          尊敬的用户，为了向您提供更优质的服务，在您使用码上朝阳程序前，您需要通过点击“我已阅读并同意本温馨提示内容及相关协议”以表示您充分知悉、理解并同意本温馨提示相关协议的各项规则，包括：我们会在您开启位置权限后访问获取您的位置信息，根据您的位置信息提供更契合您需求的服务内容，比如首页为您推荐定位所在的社区信息和服务信息。</text
        >
        <text
          class="text-[#038AFE] text-[26rpx] mt-1 mb-8 text-left w-[100%]"
          @click="onPageJump('/subPages/privacy/index')"
          >《码上朝阳隐私权政策》</text
        >
        <div class="flex flex-row justify-around w-[100%]">
          <div
            class="bg-white text-[24rpx] text-black w-20 h-8 leading-8 text-center border-[#707070] border-solid border-1"
            @click="onPrivacy(1)"
          >
            不同意
          </div>
          <div
            class="bg-[#489DFB] text-[24rpx] text-white w-20 h-8 leading-8 text-center"
            @click="onPrivacy(2)"
          >
            同意
          </div>
        </div>
      </view>
    </up-popup>
    <up-toast ref="uToastRef"></up-toast>
  </view>
</template>

<script setup lang="ts">
import { onPageJump } from "@/utils/tools";

const uToastRef = <any>ref(null);
const showPopup = ref(true);
const onPrivacy = (flag: any) => {
  uni.setStorageSync("privacySatus", flag);
  showPopup.value = false;
  uni.redirectTo({
    url: "/pages/crowd/home/index",
  });
};
onShow(() => {
  uni.hideHomeButton();
});
</script>

<style lang="scss" scoped>
.entrance-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}
</style>
